<clr-modal [(clrModalOpen)]="showInfoModal" [clrModalSize]="'lg'" [clrModalClosable]=false>
  <h3 class="modal-title">主机信息</h3>
  <div class="modal-body">
    <div *ngIf="host!=null && !loading">
      <h5>基本信息</h5>
      <hr/>
      CPU:{{host.cpu_core}} 核<br/>
      内存:{{host.memory}} MB<br/>
      操作系统:{{host.os}} {{host.os_version}}<br/>
      <h5>磁盘信息</h5>
      <hr/>
      <clr-datagrid>
        <clr-dg-column>名称</clr-dg-column>
        <clr-dg-column>大小</clr-dg-column>

        <clr-dg-row *clrDgItems="let volume of host.volumes" [clrDgItem]="volume">
          <clr-dg-cell>{{volume.name}}</clr-dg-cell>
          <clr-dg-cell>{{volume.size}}</clr-dg-cell>
        </clr-dg-row>
      </clr-datagrid>
      <br/>
      <div *ngIf="host.gpus.length>0">
        <h5>显卡信息</h5>
        <hr/>
        <clr-datagrid>
          <clr-dg-column>名称</clr-dg-column>
          <clr-dg-row *clrDgItems="let gpu of host.gpus" [clrDgItem]="gpu">
            <clr-dg-cell>{{gpu.name}}</clr-dg-cell>
          </clr-dg-row>
        </clr-datagrid>
      </div>
      <h5>健康检查</h5>
      <hr/>
      <clr-datagrid>
        <clr-dg-column>原因</clr-dg-column>
        <clr-dg-column>采集时间</clr-dg-column>
        <clr-dg-column>状态</clr-dg-column>
        <clr-dg-column>消息</clr-dg-column>

        <clr-dg-row *clrDgItems="let con of host.conditions" [clrDgItem]="con">
          <clr-dg-cell>{{con.reason}}</clr-dg-cell>
          <clr-dg-cell>{{con.last_time}}</clr-dg-cell>
          <clr-dg-cell style="text-align: center">
            <i class="fa fa-check" aria-hidden="true" *ngIf="con.status"></i>
            <i class="fa fa-close" aria-hidden="true" *ngIf="!con.status"></i>
          </clr-dg-cell>
          <clr-dg-cell>{{con.message}}</clr-dg-cell>
        </clr-dg-row>
      </clr-datagrid>
    </div>
    <div *ngIf="loading" style="text-align: center">
      <clr-spinner></clr-spinner>
    </div>
  </div>
  <div class="modal-footer">
    <button type="button" class="btn" (click)="cancel()" [disabled]="loading">取消</button>
    <button type="button" class="btn" (click)="refresh()" [disabled]="loading">刷新</button>
  </div>
</clr-modal>
